#region Copyright RenGuiYou. All rights reserved.
//=====================================================
// NeatlyFrameWork
// Author:      RenGuiyou
// Feedback: 	mailto:750539605@qq.com
//=====================================================
#endregion

using System;
using UnityEngine;
using UnityEngine.UI;

public static class UnityExtends
{
    #region RectTransform-Get
    public static RectTransform rectTransform(this GameObject go)
    {
        return go.transform as RectTransform;
    }

    public static RectTransform rectTransform(this Component cp)
    {
        return cp.transform as RectTransform;
    }
    #endregion

    #region Active
    public static void SetActive(this Component cp, bool value)
    {
        cp.gameObject.SetActive(value);
    }

    public static void SetActive(this Transform rt, bool value)
    {
        rt.gameObject.SetActive(value);
    }
    #endregion

    #region Parent
    public static void SetParent(this GameObject go, GameObject parent)
    {
        go.transform.SetParent(parent.transform);
    }

    public static void SetParent(this GameObject go, Transform parent)
    {
        go.transform.SetParent(parent);
    }

    public static void SetParent(this Component cp, Transform parent)
    {
        cp.transform.SetParent(parent);
    }

    public static void SetParent(this Component cp, GameObject parent)
    {
        cp.transform.SetParent(parent.transform);
    }

    public static void SetParent(this Transform tf, GameObject parent)
    {
        tf.SetParent(parent.transform);
    }
    #endregion

    #region Position-Set
    public static void SetPosition(this Transform rt, Vector3 value)
    {
        rt.position = value;
    }

    public static void SetPosition(this GameObject go, Vector3 value)
    {
        go.transform.position = value;
    }

    public static void SetPosition(this Component cp, Vector3 value)
    {
        cp.transform.position = value;
    }

    public static void SetPositionOne(this Transform rt, float value = 1)
    {
        rt.position = value * Vector3.one;
    }

    public static void SetPositionOne(this GameObject go, float value = 1)
    {
        go.transform.position = value * Vector3.one;
    }

    public static void SetPositionOne(this Component cp, float value = 1)
    {
        cp.transform.position = value * Vector3.one;
    }

    public static void SetPositionX(this Transform rt, float value)
    {
        Vector3 v = rt.position;
        v.x = value;
        rt.position = v;
    }

    public static void SetPositionX(this GameObject go, float value)
    {
        go.transform.SetPositionX(value);
    }

    public static void SetPositionX(this Component cp, float value)
    {
        cp.transform.SetPositionX(value);
    }

    public static void SetPositionY(this Transform rt, float value)
    {
        Vector3 v = rt.position;
        v.y = value;
        rt.position = v;
    }

    public static void SetPositionY(this GameObject go, float value)
    {
        go.transform.SetPositionY(value);
    }

    public static void SetPositionY(this Component cp, float value)
    {
        cp.transform.SetPositionY(value);
    }

    public static void SetPositionZ(this Transform rt, float value)
    {
        Vector3 v = rt.position;
        v.z = value;
        rt.position = v;
    }

    public static void SetPositionZ(this GameObject go, float value)
    {
        go.transform.SetPositionZ(value);
    }

    public static void SetPositionZ(this Component cp, float value)
    {
        cp.transform.SetPositionZ(value);
    }
    #endregion

    #region Position-Get
    public static Vector3 GetPosition(this Transform rt)
    {
        return rt.position;
    }

    public static Vector3 GetPosition(this GameObject go)
    {
        return go.transform.position;
    }

    public static Vector3 GetPosition(this Component cp)
    {
        return cp.transform.position;
    }

    public static float GetPositionX(this Transform rt)
    {
        return rt.position.x;
    }

    public static float GetPositionX(this GameObject go)
    {
        return go.transform.position.x;
    }

    public static float GetPositionX(this Component cp)
    {
        return cp.transform.position.x;
    }

    public static float GetPositionY(this Transform rt)
    {
        return rt.position.y;
    }

    public static float GetPositionY(this GameObject go)
    {
        return go.transform.position.y;
    }

    public static float GetPositionY(this Component cp)
    {
        return cp.transform.position.y;
    }

    public static float GetPositionZ(this Transform rt)
    {
        return rt.position.z;
    }

    public static float GetPositionZ(this GameObject go)
    {
        return go.transform.position.z;
    }

    public static float GetPositionZ(this Component cp)
    {
        return cp.transform.position.z;
    }
    #endregion

    #region EulerAngles-Set
    public static void SetEulerAngles(this Transform rt, Vector3 value)
    {
        rt.eulerAngles = value;
    }

    public static void SetEulerAngles(this Transform rt, float x, float y, float z)
    {
        rt.eulerAngles = new Vector3(x, y, z);
    }

    public static void SetEulerAngles(this GameObject go, Vector3 value)
    {
        go.transform.eulerAngles = value;
    }

    public static void SetEulerAngles(this GameObject go, float x, float y, float z)
    {
        go.transform.eulerAngles = new Vector3(x, y, z);
    }

    public static void SetEulerAngles(this Component cp, Vector3 value)
    {
        cp.transform.eulerAngles = value;
    }

    public static void SetEulerAngles(this Component cp, float x, float y, float z)
    {
        cp.transform.eulerAngles = new Vector3(x, y, z);
    }

    public static void SetEulerAnglesOne(this Transform rt, float value = 1)
    {
        rt.eulerAngles = value * Vector3.one;
    }

    public static void SetEulerAnglesOne(this GameObject go, float value = 1)
    {
        go.transform.eulerAngles = value * Vector3.one;
    }

    public static void SetEulerAnglesOne(this Component cp, float value = 1)
    {
        cp.transform.eulerAngles = value * Vector3.one;
    }

    public static void SetEulerAnglesX(this Transform rt, float value)
    {
        Vector3 v = rt.eulerAngles;
        v.x = value;
        rt.eulerAngles = v;
    }

    public static void SetEulerAnglesX(this GameObject go, float value)
    {
        go.transform.SetEulerAnglesX(value);
    }

    public static void SetEulerAnglesX(this Component cp, float value)
    {
        cp.transform.SetEulerAnglesX(value);
    }

    public static void SetEulerAnglesY(this Transform rt, float value)
    {
        Vector3 v = rt.eulerAngles;
        v.y = value;
        rt.eulerAngles = v;
    }

    public static void SetEulerAnglesY(this GameObject go, float value)
    {
        go.transform.SetEulerAnglesY(value);
    }

    public static void SetEulerAnglesY(this Component cp, float value)
    {
        cp.transform.SetEulerAnglesY(value);
    }

    public static void SetEulerAnglesZ(this Transform rt, float value)
    {
        Vector3 v = rt.eulerAngles;
        v.z = value;
        rt.eulerAngles = v;
    }

    public static void SetEulerAnglesZ(this GameObject go, float value)
    {
        go.transform.SetEulerAnglesZ(value);
    }

    public static void SetEulerAnglesZ(this Component cp, float value)
    {
        cp.transform.SetEulerAnglesZ(value);
    }
    #endregion

    #region EulerAngles-Get
    public static Vector3 GetEulerAngles(this Transform rt)
    {
        return rt.eulerAngles;
    }

    public static Vector3 GetEulerAngles(this GameObject go)
    {
        return go.transform.eulerAngles;
    }

    public static Vector3 GetEulerAngles(this Component cp)
    {
        return cp.transform.eulerAngles;
    }

    public static float GetEulerAnglesX(this Transform rt)
    {
        return rt.eulerAngles.x;
    }

    public static float GetEulerAnglesX(this GameObject go)
    {
        return go.transform.eulerAngles.x;
    }

    public static float GetEulerAnglesX(this Component cp)
    {
        return cp.transform.eulerAngles.x;
    }

    public static float GetEulerAnglesY(this Transform rt)
    {
        return rt.eulerAngles.y;
    }

    public static float GetEulerAnglesY(this GameObject go)
    {
        return go.transform.eulerAngles.y;
    }

    public static float GetEulerAnglesY(this Component cp)
    {
        return cp.transform.eulerAngles.y;
    }

    public static float GetEulerAnglesZ(this Transform rt)
    {
        return rt.eulerAngles.z;
    }

    public static float GetEulerAnglesZ(this GameObject go)
    {
        return go.transform.eulerAngles.z;
    }

    public static float GetEulerAnglesZ(this Component cp)
    {
        return cp.transform.eulerAngles.z;
    }
    #endregion

    #region LocalPosition-Set
    public static void SetLocalPosition(this Transform rt, Vector3 value)
    {
        rt.localPosition = value;
    }

    public static void SetLocalPosition(this Transform rt, float x, float y, float z)
    {
        rt.localPosition = new Vector3(x, y, z);
    }

    public static void SetLocalPosition(this GameObject go, Vector3 value)
    {
        go.transform.localPosition = value;
    }

    public static void SetLocalPosition(this GameObject go, float x, float y, float z)
    {
        go.transform.localPosition = new Vector3(x, y, z);
    }

    public static void SetLocalPosition(this Component cp, Vector3 value)
    {
        cp.transform.localPosition = value;
    }

    public static void SetLocalPosition(this Component cp, float x, float y, float z)
    {
        cp.transform.localPosition = new Vector3(x, y, z);
    }

    public static void SetLocalPositionOne(this Transform rt, float value = 1)
    {
        rt.localPosition = value * Vector3.one;
    }

    public static void SetLocalPositionOne(this GameObject go, float value = 1)
    {
        go.transform.localPosition = value * Vector3.one;
    }

    public static void SetLocalPositionOne(this Component cp, float value = 1)
    {
        cp.transform.localPosition = value * Vector3.one;
    }

    public static void SetLocalPositionX(this Transform rt, float value)
    {
        Vector3 v = rt.localPosition;
        v.x = value;
        rt.localPosition = v;
    }

    public static void SetLocalPositionX(this GameObject go, float value)
    {
        go.transform.SetLocalPositionX(value);
    }

    public static void SetLocalPositionX(this Component cp, float value)
    {
        cp.transform.SetLocalPositionX(value);
    }

    public static void SetLocalPositionY(this Transform rt, float value)
    {
        Vector3 v = rt.localPosition;
        v.y = value;
        rt.localPosition = v;
    }

    public static void SetLocalPositionY(this GameObject go, float value)
    {
        go.transform.SetLocalPositionY(value);
    }

    public static void SetLocalPositionY(this Component cp, float value)
    {
        cp.transform.SetLocalPositionY(value);
    }

    public static void SetLocalPositionZ(this Transform rt, float value)
    {
        Vector3 v = rt.localPosition;
        v.z = value;
        rt.localPosition = v;
    }

    public static void SetLocalPositionZ(this GameObject go, float value)
    {
        go.transform.SetLocalPositionZ(value);
    }

    public static void SetLocalPositionZ(this Component cp, float value)
    {
        cp.transform.SetLocalPositionZ(value);
    }
    #endregion

    #region LocalPosition-Get
    public static Vector3 GetLocalPosition(this Transform rt)
    {
        return rt.localPosition;
    }

    public static Vector3 GetLocalPosition(this GameObject go)
    {
        return go.transform.localPosition;
    }

    public static Vector3 GetLocalPosition(this Component cp)
    {
        return cp.transform.localPosition;
    }

    public static float GetLocalPositionX(this Transform rt)
    {
        return rt.localPosition.x;
    }

    public static float GetLocalPositionX(this GameObject go)
    {
        return go.transform.localPosition.x;
    }

    public static float GetLocalPositionX(this Component cp)
    {
        return cp.transform.localPosition.x;
    }

    public static float GetLocalPositionY(this Transform rt)
    {
        return rt.localPosition.y;
    }

    public static float GetLocalPositionY(this GameObject go)
    {
        return go.transform.localPosition.y;
    }

    public static float GetLocalPositionY(this Component cp)
    {
        return cp.transform.localPosition.y;
    }

    public static float GetLocalPositionZ(this Transform rt)
    {
        return rt.localPosition.z;
    }

    public static float GetLocalPositionZ(this GameObject go)
    {
        return go.transform.localPosition.z;
    }

    public static float GetLocalPositionZ(this Component cp)
    {
        return cp.transform.localPosition.z;
    }
    #endregion

    #region LocalScale-Set
    public static void SetLocalScale(this Transform rt, Vector3 value)
    {
        rt.localScale = value;
    }

    public static void SetLocalScale(this Transform rt, float x, float y, float z)
    {
        rt.localScale = new Vector3(x, y, z);
    }

    public static void SetLocalScale(this GameObject go, Vector3 value)
    {
        go.transform.localScale = value;
    }

    public static void SetLocalScale(this GameObject go, float x, float y, float z)
    {
        go.transform.localScale = new Vector3(x, y, z);
    }

    public static void SetLocalScale(this Component cp, Vector3 value)
    {
        cp.transform.localScale = value;
    }

    public static void SetLocalScale(this Component cp, float x, float y, float z)
    {
        cp.transform.localScale = new Vector3(x, y, z);
    }

    public static void SetLocalScaleOne(this Transform rt, float value = 1)
    {
        rt.localScale = value * Vector3.one;
    }

    public static void SetLocalScaleOne(this GameObject go, float value = 1)
    {
        go.transform.localScale = value * Vector3.one;
    }

    public static void SetLocalScaleOne(this Component cp, float value = 1)
    {
        cp.transform.localScale = value * Vector3.one;
    }

    public static void SetLocalScaleX(this Transform rt, float value)
    {
        Vector3 v = rt.localScale;
        v.x = value;
        rt.localScale = v;
    }

    public static void SetLocalScaleX(this GameObject go, float value)
    {
        go.transform.SetLocalScaleX(value);
    }

    public static void SetLocalScaleX(this Component cp, float value)
    {
        cp.transform.SetLocalScaleX(value);
    }

    public static void SetLocalScaleY(this Transform rt, float value)
    {
        Vector3 v = rt.localScale;
        v.y = value;
        rt.localScale = v;
    }

    public static void SetLocalScaleY(this GameObject go, float value)
    {
        go.transform.SetLocalScaleY(value);
    }

    public static void SetLocalScaleY(this Component cp, float value)
    {
        cp.transform.SetLocalScaleY(value);
    }

    public static void SetLocalScaleZ(this Transform rt, float value)
    {
        Vector3 v = rt.localScale;
        v.z = value;
        rt.localScale = v;
    }

    public static void SetLocalScaleZ(this GameObject go, float value)
    {
        go.transform.SetLocalScaleZ(value);
    }

    public static void SetLocalScaleZ(this Component cp, float value)
    {
        cp.transform.SetLocalScaleZ(value);
    }
    #endregion

    #region LocalScale-Get
    public static Vector3 GetLocalScale(this Transform rt)
    {
        return rt.localScale;
    }

    public static Vector3 GetLocalScale(this GameObject go)
    {
        return go.transform.localScale;
    }

    public static Vector3 GetLocalScale(this Component cp)
    {
        return cp.transform.localScale;
    }

    public static float GetLocalScaleX(this Transform rt)
    {
        return rt.localScale.x;
    }

    public static float GetLocalScaleX(this GameObject go)
    {
        return go.transform.localScale.x;
    }

    public static float GetLocalScaleX(this Component cp)
    {
        return cp.transform.localScale.x;
    }

    public static float GetLocalScaleY(this Transform rt)
    {
        return rt.localScale.y;
    }

    public static float GetLocalScaleY(this GameObject go)
    {
        return go.transform.localScale.y;
    }

    public static float GetLocalScaleY(this Component cp)
    {
        return cp.transform.localScale.y;
    }

    public static float GetLocalScaleZ(this Transform rt)
    {
        return rt.localScale.z;
    }

    public static float GetLocalScaleZ(this GameObject go)
    {
        return go.transform.localScale.z;
    }

    public static float GetLocalScaleZ(this Component cp)
    {
        return cp.transform.localScale.z;
    }
    #endregion

    #region LocalEulerAngles-Set
    public static void SetLocalEulerAngles(this Transform rt, Vector3 value)
    {
        rt.localEulerAngles = value;
    }

    public static void SetLocalEulerAngles(this Transform rt, float x, float y, float z)
    {
        rt.localEulerAngles = new Vector3(x, y, z);
    }

    public static void SetLocalEulerAngles(this GameObject go, Vector3 value)
    {
        go.transform.localEulerAngles = value;
    }

    public static void SetLocalEulerAngles(this GameObject go, float x, float y, float z)
    {
        go.transform.localEulerAngles = new Vector3(x, y, z);
    }

    public static void SetLocalEulerAngles(this Component cp, Vector3 value)
    {
        cp.transform.localEulerAngles = value;
    }

    public static void SetLocalEulerAngles(this Component cp, float x, float y, float z)
    {
        cp.transform.localEulerAngles = new Vector3(x, y, z);
    }

    public static void SetLocalEulerAnglesOne(this Transform rt, float value = 1)
    {
        rt.localEulerAngles = value * Vector3.one;
    }

    public static void SetLocalEulerAnglesOne(this GameObject go, float value = 1)
    {
        go.transform.localEulerAngles = value * Vector3.one;
    }

    public static void SetLocalEulerAnglesOne(this Component cp, float value = 1)
    {
        cp.transform.localEulerAngles = value * Vector3.one;
    }

    public static void SetLocalEulerAnglesX(this Transform rt, float value)
    {
        Vector3 v = rt.localEulerAngles;
        v.x = value;
        rt.localEulerAngles = v;
    }

    public static void SetLocalEulerAnglesX(this GameObject go, float value)
    {
        go.transform.SetLocalEulerAnglesX(value);
    }

    public static void SetLocalEulerAnglesX(this Component cp, float value)
    {
        cp.transform.SetLocalEulerAnglesX(value);
    }

    public static void SetLocalEulerAnglesY(this Transform rt, float value)
    {
        Vector3 v = rt.localEulerAngles;
        v.y = value;
        rt.localEulerAngles = v;
    }

    public static void SetLocalEulerAnglesY(this GameObject go, float value)
    {
        go.transform.SetLocalEulerAnglesY(value);
    }

    public static void SetLocalEulerAnglesY(this Component cp, float value)
    {
        cp.transform.SetLocalEulerAnglesY(value);
    }

    public static void SetLocalEulerAnglesZ(this Transform rt, float value)
    {
        Vector3 v = rt.localEulerAngles;
        v.z = value;
        rt.localEulerAngles = v;
    }

    public static void SetLocalEulerAnglesZ(this GameObject go, float value)
    {
        go.transform.SetLocalEulerAnglesZ(value);
    }

    public static void SetLocalEulerAnglesZ(this Component cp, float value)
    {
        cp.transform.SetLocalEulerAnglesZ(value);
    }
    #endregion

    #region LocalEulerAngles-Get
    public static Vector3 GetLocalEulerAngles(this Transform rt)
    {
        return rt.localEulerAngles;
    }

    public static Vector3 GetLocalEulerAngles(this GameObject go)
    {
        return go.transform.localEulerAngles;
    }

    public static Vector3 GetLocalEulerAngles(this Component cp)
    {
        return cp.transform.localEulerAngles;
    }

    public static float GetLocalEulerAnglesX(this Transform rt)
    {
        return rt.localEulerAngles.x;
    }

    public static float GetLocalEulerAnglesX(this GameObject go)
    {
        return go.transform.localEulerAngles.x;
    }

    public static float GetLocalEulerAnglesX(this Component cp)
    {
        return cp.transform.localEulerAngles.x;
    }

    public static float GetLocalEulerAnglesY(this Transform rt)
    {
        return rt.localEulerAngles.y;
    }

    public static float GetLocalEulerAnglesY(this GameObject go)
    {
        return go.transform.localEulerAngles.y;
    }

    public static float GetLocalEulerAnglesY(this Component cp)
    {
        return cp.transform.localEulerAngles.y;
    }

    public static float GetLocalEulerAnglesZ(this Transform rt)
    {
        return rt.localEulerAngles.z;
    }

    public static float GetLocalEulerAnglesZ(this GameObject go)
    {
        return go.transform.localEulerAngles.z;
    }

    public static float GetLocalEulerAnglesZ(this Component cp)
    {
        return cp.transform.localEulerAngles.z;
    }
    #endregion

    #region AnchorMin-Set
    public static void SetAnchorMinX(this RectTransform rt, float x)
    {
        rt.anchorMin = new Vector2(x, rt.anchorMin.y);
    }

    public static void SetAnchorMinX(this GameObject go, float x)
    {
        var rt = go.rectTransform();
        rt.SetAnchorMinX(x);
    }

    public static void SetAnchorMinX(this Component cp, float x)
    {
        var rt = cp.rectTransform();
        rt.SetAnchorMinX(x);
    }

    public static void SetAnchorMinY(this RectTransform rt, float y)
    {
        rt.anchorMin = new Vector2(rt.anchorMin.x, y);
    }

    public static void SetAnchorMinY(this GameObject go, float y)
    {
        var rt = go.rectTransform();
        rt.SetAnchorMinY(y);
    }

    public static void SetAnchorMinY(this Component cp, float y)
    {
        var rt = cp.rectTransform();
        rt.SetAnchorMinY(y);
    }

    public static void SetAnchorMin(this RectTransform rt, float x, float y)
    {
        rt.anchorMin = new Vector2(x, y);
    }

    public static void SetAnchorMin(this GameObject go, float x, float y)
    {
        var rt = go.rectTransform();
        rt.SetAnchorMin(x, y);
    }

    public static void SetAnchorMin(this Component cp, float x, float y)
    {
        var rt = cp.rectTransform();
        rt.SetAnchorMin(x, y);
    }
    #endregion

    #region AnchorMax-Set
    public static void SetAnchorMaxX(this RectTransform rt, float x)
    {
        rt.anchorMax = new Vector2(x, rt.anchorMax.y);
    }

    public static void SetAnchorMaxX(this GameObject go, float x)
    {
        var rt = go.rectTransform();
        rt.SetAnchorMaxX(x);
    }

    public static void SetAnchorMaxX(this Component cp, float x)
    {
        var rt = cp.rectTransform();
        rt.SetAnchorMaxX(x);
    }

    public static void SetAnchorMaxY(this RectTransform rt, float y)
    {
        rt.anchorMax = new Vector2(rt.anchorMax.x, y);
    }

    public static void SetAnchorMaxY(this GameObject go, float y)
    {
        var rt = go.rectTransform();
        rt.SetAnchorMaxY(y);
    }

    public static void SetAnchorMaxY(this Component cp, float y)
    {
        var rt = cp.rectTransform();
        rt.SetAnchorMaxY(y);
    }

    public static void SetAnchorMax(this RectTransform rt, float x, float y)
    {
        rt.anchorMax = new Vector2(x, y);
    }

    public static void SetAnchorMax(this GameObject go, float x, float y)
    {
        var rt = go.rectTransform();
        rt.SetAnchorMax(x, y);
    }

    public static void SetAnchorMax(this Component cp, float x, float y)
    {
        var rt = cp.rectTransform();
        rt.SetAnchorMax(x, y);
    }
    #endregion

    #region Pivot-Set
    public static void SetPivotX(this RectTransform rt, float x)
    {
        rt.pivot = new Vector2(x, rt.pivot.y);
    }

    public static void SetPivotY(this RectTransform rt, float y)
    {
        rt.pivot = new Vector2(rt.pivot.x, y);
    }

    public static void SetPivot(this RectTransform rt, float x, float y)
    {
        rt.pivot = new Vector2(x, y);
    }

    public static void SetPivotX(this Component cp, float x)
    {
        var rt = cp.rectTransform();
        rt.pivot = new Vector2(x, rt.pivot.y);
    }

    public static void SetPivotY(this Component cp, float y)
    {
        var rt = cp.rectTransform();
        rt.pivot = new Vector2(rt.pivot.x, y);
    }

    public static void SetPivot(this Component cp, float x, float y)
    {
        var rt = cp.rectTransform();
        rt.pivot = new Vector2(x, y);
    }
    #endregion

    #region AnchoredPosition-Set
    public static void SetAnchoredPosition(this RectTransform rt, Vector2 value)
    {
        rt.anchoredPosition = value;
    }

    public static void SetAnchoredPosition(this GameObject go, Vector2 value)
    {
        go.rectTransform().anchoredPosition = value;
    }

    public static void SetAnchoredPosition(this Component cp, Vector2 value)
    {
        cp.rectTransform().anchoredPosition = value;
    }

    public static void SetAnchoredPosition(this RectTransform rt, RectTransform rt2)
    {
        rt.anchoredPosition = rt2.anchoredPosition;
    }

    public static void SetAnchoredPosition(this GameObject go, RectTransform rt2)
    {
        go.rectTransform().anchoredPosition = rt2.anchoredPosition;
    }

    public static void SetAnchoredPosition(this Component cp, RectTransform rt2)
    {
        cp.rectTransform().anchoredPosition = rt2.anchoredPosition;
    }

    public static void SetAnchoredPosition(this RectTransform rt, float x, float y)
    {
        rt.anchoredPosition = new Vector2(x, y);
    }

    public static void SetAnchoredPosition(this GameObject go, float x, float y)
    {
        go.rectTransform().anchoredPosition = new Vector2(x, y);
    }

    public static void SetAnchoredPosition(this Component cp, float x, float y)
    {
        cp.rectTransform().anchoredPosition = new Vector2(x, y);
    }

    public static void SetAnchoredPositionOne(this RectTransform rt, float value = 1)
    {
        rt.anchoredPosition = value * Vector2.one;
    }

    public static void SetAnchoredPositionOne(this GameObject go, float value = 1)
    {
        go.rectTransform().SetAnchoredPositionOne(value);
    }

    public static void SetAnchoredPositionOne(this Component cp, float value = 1)
    {
        cp.rectTransform().SetAnchoredPositionOne(value);
    }

    public static void SetAnchoredPositionX(this RectTransform rt, float value)
    {
        Vector2 v = rt.anchoredPosition;
        v.x = value;
        rt.anchoredPosition = v;
    }

    public static void SetAnchoredPositionX(this GameObject go, float value)
    {
        go.rectTransform().SetAnchoredPositionX(value);
    }

    public static void SetAnchoredPositionX(this Component cp, float value)
    {
        cp.rectTransform().SetAnchoredPositionX(value);
    }

    public static void SetAnchoredPositionY(this RectTransform rt, float value)
    {
        Vector2 v = rt.anchoredPosition;
        v.y = value;
        rt.anchoredPosition = v;
    }

    public static void SetAnchoredPositionY(this GameObject go, float value)
    {
        go.rectTransform().SetAnchoredPositionY(value);
    }

    public static void SetAnchoredPositionY(this Component cp, float value)
    {
        cp.rectTransform().SetAnchoredPositionY(value);
    }
    #endregion

    #region AnchoredPosition-Get
    public static Vector2 GetAnchoredPosition(this RectTransform rt)
    {
        return rt.anchoredPosition;
    }

    public static Vector2 GetAnchoredPosition(this GameObject go)
    {
        return go.rectTransform().anchoredPosition;
    }

    public static Vector2 GetAnchoredPosition(this Component cp)
    {
        return cp.rectTransform().anchoredPosition;
    }

    public static float GetAnchoredPositionX(this RectTransform rt)
    {
        return rt.anchoredPosition.x;
    }

    public static float GetAnchoredPositionX(this GameObject go)
    {
        return go.rectTransform().anchoredPosition.x;
    }

    public static float GetAnchoredPositionX(this Component cp)
    {
        return cp.rectTransform().anchoredPosition.x;
    }

    public static float GetAnchoredPositionY(this RectTransform rt)
    {
        return rt.anchoredPosition.y;
    }

    public static float GetAnchoredPositionY(this GameObject go)
    {
        return go.rectTransform().anchoredPosition.y;
    }

    public static float GetAnchoredPositionY(this Component cp)
    {
        return cp.rectTransform().anchoredPosition.y;
    }
    #endregion

    #region AnchoredPosition3D-Set
    public static void SetAnchoredPosition3D(this RectTransform rt, Vector3 value)
    {
        rt.anchoredPosition3D = value;
    }

    public static void SetAnchoredPosition3D(this GameObject go, Vector3 value)
    {
        go.rectTransform().anchoredPosition3D = value;
    }

    public static void SetAnchoredPosition3D(this Component cp, Vector3 value)
    {
        cp.rectTransform().anchoredPosition3D = value;
    }

    public static void SetAnchoredPosition3DOne(this RectTransform rt, float value = 1)
    {
        rt.anchoredPosition3D = value * Vector3.one;
    }

    public static void SetAnchoredPosition3DOne(this GameObject go, float value = 1)
    {
        go.rectTransform().anchoredPosition3D = value * Vector3.one;
    }

    public static void SetAnchoredPosition3DOne(this Component cp, float value = 1)
    {
        cp.rectTransform().anchoredPosition3D = value * Vector3.one;
    }

    public static void SetAnchoredPosition3DX(this RectTransform rt, float value)
    {
        Vector3 v = rt.anchoredPosition3D;
        v.x = value;
        rt.anchoredPosition3D = v;
    }

    public static void SetAnchoredPosition3DX(this GameObject go, float value)
    {
        go.rectTransform().SetAnchoredPosition3DX(value);
    }

    public static void SetAnchoredPosition3DX(this Component cp, float value)
    {
        cp.rectTransform().SetAnchoredPosition3DX(value);
    }

    public static void SetAnchoredPosition3DY(this RectTransform rt, float value)
    {
        Vector3 v = rt.anchoredPosition3D;
        v.y = value;
        rt.anchoredPosition3D = v;
    }

    public static void SetAnchoredPosition3DY(this GameObject go, float value)
    {
        go.rectTransform().SetAnchoredPosition3DY(value);
    }

    public static void SetAnchoredPosition3DY(this Component cp, float value)
    {
        cp.rectTransform().SetAnchoredPosition3DY(value);
    }

    public static void SetAnchoredPosition3DZ(this RectTransform rt, float value)
    {
        Vector3 v = rt.anchoredPosition3D;
        v.z = value;
        rt.anchoredPosition3D = v;
    }

    public static void SetAnchoredPosition3DZ(this GameObject go, float value)
    {
        go.rectTransform().SetAnchoredPosition3DZ(value);
    }

    public static void SetAnchoredPosition3DZ(this Component cp, float value)
    {
        cp.rectTransform().SetAnchoredPosition3DZ(value);
    }
    #endregion

    #region AnchoredPosition3D-Get
    public static Vector3 GetAnchoredPosition3D(this RectTransform rt)
    {
        return rt.anchoredPosition3D;
    }

    public static Vector3 GetAnchoredPosition3D(this GameObject go)
    {
        return go.rectTransform().anchoredPosition3D;
    }

    public static Vector3 GetAnchoredPosition3D(this Component cp)
    {
        return cp.rectTransform().anchoredPosition3D;
    }

    public static float GetAnchoredPosition3DX(this RectTransform rt)
    {
        return rt.anchoredPosition3D.x;
    }

    public static float GetAnchoredPosition3DX(this GameObject go)
    {
        return go.rectTransform().anchoredPosition3D.x;
    }

    public static float GetAnchoredPosition3DX(this Component cp)
    {
        return cp.rectTransform().anchoredPosition3D.x;
    }

    public static float GetAnchoredPosition3DY(this RectTransform rt)
    {
        return rt.anchoredPosition3D.y;
    }

    public static float GetAnchoredPosition3DY(this GameObject go)
    {
        return go.rectTransform().anchoredPosition3D.y;
    }

    public static float GetAnchoredPosition3DY(this Component cp)
    {
        return cp.rectTransform().anchoredPosition3D.y;
    }

    public static float GetAnchoredPosition3DZ(this RectTransform rt)
    {
        return rt.anchoredPosition3D.z;
    }

    public static float GetAnchoredPosition3DZ(this GameObject go)
    {
        return go.rectTransform().anchoredPosition3D.z;
    }

    public static float GetAnchoredPosition3DZ(this Component cp)
    {
        return cp.rectTransform().anchoredPosition3D.z;
    }
    #endregion

    #region SizeDelta-Set
    public static void SetSizeDelta(this GameObject go, float x, float y)
    {
        go.rectTransform().sizeDelta = new Vector2(x, y);
    }

    public static void SetSizeDelta(this RectTransform rt, float x, float y)
    {
        rt.sizeDelta = new Vector2(x, y);
    }

    public static void SetSizeDelta(this Component cp, float x, float y)
    {
        cp.rectTransform().sizeDelta = new Vector2(x, y);
    }

    public static void SetSizeDelta(this RectTransform rt, Vector2 value)
    {
        rt.sizeDelta = value;
    }

    public static void SetSizeDelta(this GameObject go, Vector2 value)
    {
        go.rectTransform().sizeDelta = value;
    }

    public static void SetSizeDelta(this Component cp, Vector2 value)
    {
        cp.rectTransform().sizeDelta = value;
    }

    public static void SetSizeDeltaOne(this RectTransform rt, float value = 1)
    {
        rt.sizeDelta = value * Vector2.one;
    }

    public static void SetSizeDeltaOne(this GameObject go, float value = 1)
    {
        go.rectTransform().sizeDelta = value * Vector2.one;
    }

    public static void SetSizeDeltaOne(this Component cp, float value = 1)
    {
        cp.rectTransform().sizeDelta = value * Vector2.one;
    }

    public static void SetSizeDeltaX(this RectTransform rt, float value)
    {
        Vector2 v = rt.sizeDelta;
        v.x = value;
        rt.sizeDelta = v;
    }

    public static void SetSizeDeltaX(this GameObject go, float value)
    {
        go.rectTransform().SetSizeDeltaX(value);
    }

    public static void SetSizeDeltaX(this Component cp, float value)
    {
        cp.rectTransform().SetSizeDeltaX(value);
    }

    public static void SetSizeDeltaY(this RectTransform rt, float value)
    {
        Vector2 v = rt.sizeDelta;
        v.y = value;
        rt.sizeDelta = v;
    }

    public static void SetSizeDeltaY(this GameObject go, float value)
    {
        go.rectTransform().SetSizeDeltaY(value);
    }

    public static void SetSizeDeltaY(this Component cp, float value)
    {
        cp.rectTransform().SetSizeDeltaY(value);
    }
    #endregion

    #region SizeDelta-Get
    public static Vector2 GetSizeDelta(this RectTransform rt)
    {
        return rt.sizeDelta;
    }

    public static Vector2 GetSizeDelta(this GameObject go)
    {
        return go.rectTransform().sizeDelta;
    }

    public static Vector2 GetSizeDelta(this Component cp)
    {
        return cp.rectTransform().sizeDelta;
    }

    public static float GetSizeDeltaX(this RectTransform rt)
    {
        return rt.sizeDelta.x;
    }

    public static float GetSizeDeltaX(this GameObject go)
    {
        return go.rectTransform().sizeDelta.x;
    }

    public static float GetSizeDeltaX(this Component cp)
    {
        return cp.rectTransform().sizeDelta.x;
    }

    public static float GetSizeDeltaY(this RectTransform rt)
    {
        return rt.sizeDelta.y;
    }

    public static float GetSizeDeltaY(this GameObject go)
    {
        return go.rectTransform().sizeDelta.y;
    }

    public static float GetSizeDeltaY(this Component cp)
    {
        return cp.rectTransform().sizeDelta.y;
    }
    #endregion

    #region Rect-Width-Get
    public static float GetRectWidth(this RectTransform rt)
    {
        return rt.rect.width;
    }

    public static float GetRectWidth(this GameObject go)
    {
        return go.rectTransform().rect.width;
    }

    public static float GetRectWidth(this Component cp)
    {
        return cp.rectTransform().rect.width;
    }
    #endregion

    #region Rect-Height-Get
    public static float GetRectHeight(this RectTransform rt)
    {
        return rt.rect.height;
    }

    public static float GetRectHeight(this GameObject go)
    {
        return go.rectTransform().rect.height;
    }

    public static float GetRectHeight(this Component cp)
    {
        return cp.rectTransform().rect.height;
    }
    #endregion

    #region Behaviour
    public static void SetEnabled(this Behaviour cp, bool value)
    {
        cp.enabled = value;
    }
    #endregion
}